﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LMS.SMSH.WEB
{
    public partial class AdminStuAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        /// <summary>
        /// 添加学生
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            string sex = (ddlGender.SelectedValue == "1") ? "男" : "女";
            Int32? result = -1;
            LMSDataContext.GetLMSDB.sp_addStudent(txtStudentID.Text, txtStudentName.Text, sex, txtPassword1.Text, ref result);
            if (result == 1)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功!')", true);
            }
        }
    }
}